<?php
/**
 * common model file Created by PhpStorm.
 * User: wumengmeng
 * Date: 2020/04/24
 * Time: 15:06
 */

namespace HiCommon\Model;

class ViewFinanceOrderPay extends Base
{
    
    protected $table = 'view_finance_order_pay';
    
    protected $guarded = [];
    
    //public $timestamps = false;
    
    /**
     * 应该被调整为日期的属性
     *
     * @var array
     */
    protected $dates = [
    ];

    public function order_type_list(){
        $result = [
          'njyy',
          'ptshp',
          'wxfw',
          'wxby',
          'dljy',
        ];
        return $result;
    }


    /**
     * 关联年检预约单表
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     * @author wumengmeng <wu_mengmeng@foxmail.com>
     */
    public function order_njyy(){
        return $this->hasOne(OrderCheckpoint::class,'order_sn','order_sn');
    }

    /**
     * 关联用户表
     *
     * @author wumengmeng <wu_mengmeng@foxmail.com>
     */
    public function user(){
        return $this->belongsTo(Users::class,'user_id')->select(['id','phone','nickname','head_img']);
    }









}